<template>
    <div class="list">
        <div class="list-item" v-if="list.length">
            <div v-for="(item,index) in list" :key="index" class="item-content" @click="hook(item)">
                <div>{{item.name}}</div>
                <div>{{item.createDate}}</div>
            </div>
        </div>
        <div class="none" v-else>暂无数据</div>
    </div>
</template>

<script>
    export default {
        name: "index",
        data(){
            return {};
        },
        methods : {
            hook(item){
                this.$emit('click',item)
            }
        },
        props : {
            list : {
                type : Array,
                default : () => []
            }
        }
    }
</script>

<style lang="scss" scoped>
    .list {
        .list-item {
            .item-content {
                display: flex;
                justify-content: space-between;
                align-items: center;
                height: 40px;
                cursor: pointer;
                border-bottom: 1px dashed #c3c3c3;
            }
        }
        .none {
            background: #f1f1f1;
            width: 100%;
            text-align: center;
            height: 200px;
            line-height: 200px;
        }
    }
</style>
